Skip to content

[GIT-238] refactor: migrate types from apps/web to @plane/types#9203

Open
Rahulcheryala wants to merge 3 commits into
previewfrom
git-238/types-consolidation-packages-types
Open

[GIT-238] refactor: migrate types from apps/web to @plane/types#9203
Rahulcheryala wants to merge 3 commits into
previewfrom
git-238/types-consolidation-packages-types

Conversation

@Rahulcheryala
Copy link
Copy Markdown
Contributor

@Rahulcheryala Rahulcheryala commented Jun 3, 2026

Description

Consolidated types to @packages/types

Type of Change

  • Code refactoring

Summary by CodeRabbit

  • Refactor
    • Consolidated and centralized type definitions across the application to use a unified shared types package, improving code maintainability and consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10c7e707-25aa-4b0e-bb5c-6a791534078c

📥 Commits

Reviewing files that changed from the base of the PR and between dca6fc0 and d58d182.

📒 Files selected for processing (6)
  • apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx
  • apps/web/core/services/issue/issue_relation.service.ts
  • apps/web/core/store/issue/issue-details/relation.store.ts
  • apps/web/core/store/issue/issue-details/root.store.ts
  • packages/types/src/issues/issue-property-values.ts
  • packages/types/src/navigation-preferences.ts
✅ Files skipped from review due to trivial changes (3)
  • apps/web/core/services/issue/issue_relation.service.ts
  • apps/web/core/store/issue/issue-details/relation.store.ts
  • packages/types/src/navigation-preferences.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/types/src/issues/issue-property-values.ts
  • apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx

📝 Walkthrough

Walkthrough

This PR consolidates scattered type definitions across the codebase into the centralized @plane/types package. The changes extend the package with issue property value types and navigation preferences, update 30+ consumer files to import from the shared package instead of local paths, and remove redundant type barrel modules from apps/web/ce/types/.

Changes

Type Consolidation to Shared Package

Layer / File(s) Summary
Shared Type Package Extension
packages/types/src/index.ts, packages/types/src/issues/issue-property-values.ts, packages/types/src/navigation-preferences.ts, packages/types/src/project/activity.ts, packages/types/src/project/index.ts
@plane/types now exports TIssuePropertyValues, TIssuePropertyValueErrors, and default navigation preference constants. Project activity re-export added to package index. Navigation preference comment-only lines removed.
Project Type Imports Consolidation
apps/web/app/(all)/[workspaceSlug]/(projects)/extended-project-sidebar.tsx, apps/web/ce/components/breadcrumbs/project.tsx, apps/web/ce/components/projects/create/root.tsx, apps/web/core/components/dropdowns/project/base.tsx, apps/web/core/components/issues/filters.tsx, apps/web/core/components/project/create-project-modal.tsx, apps/web/core/components/project/create/common-attributes.tsx, apps/web/core/components/workspace/sidebar/projects-list.tsx, apps/web/core/components/navigation/project-header-button.tsx, apps/web/core/components/power-k/menus/projects.tsx, apps/web/core/services/project/project.service.ts, apps/web/core/store/project/project.store.ts
TProject and TPartialProject imports updated from @/plane-web/types and @/plane-web/types/projects to @plane/types across components, services, and stores.
Activity and Relation Type Imports Consolidation
apps/web/core/components/common/activity/activity-item.tsx, apps/web/core/components/common/activity/helper.tsx, apps/web/ce/components/relations/index.tsx, apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx, apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx, apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx, apps/web/core/components/issues/issue-detail/relation-select.tsx, apps/web/core/components/issues/relations/issue-list-item.tsx, apps/web/core/components/issues/relations/issue-list.tsx, apps/web/core/constants/gantt-chart.ts, apps/web/core/services/issue/issue_relation.service.ts, apps/web/core/store/issue/issue-details/relation.store.ts, apps/web/core/store/issue/issue-details/root.store.ts
TProjectActivity and TIssueRelationTypes imports switched from local modules to @plane/types across activity helpers, relation components, and issue stores.
Navigation and Miscellaneous Type Consolidation
apps/web/core/hooks/use-navigation-preferences.ts, apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx, apps/web/core/components/navigation/customize-navigation-dialog.tsx, apps/web/ce/hooks/pages/use-pages-pane-extensions.ts
Navigation preference defaults and property value types consolidated to @plane/types. TPersonalNavigationItemKey and INavigationPaneExtension import sources updated.
Local Type Definition Removal
apps/web/ce/types/index.ts, apps/web/ce/types/pages/pane-extensions.ts
Barrel re-export statements removed from apps/web/ce/types/ module, eliminating local type surface now available via @plane/types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Types scattered far, now unified in one,
A shared @plane/types package, cleanly done.
Old local paths fade as imports realign,
Through thirty files they dance in perfect line—
One source of truth, like carrots in a line! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is minimal and overly generic, providing only a one-line summary without substantive details about the refactoring scope, impact, or testing. Expand the description with details about which types were migrated, the rationale for consolidation, any breaking changes, and test scenarios performed to verify the refactoring.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: consolidating types from apps/web into the @plane/types package as part of a refactoring effort.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch git-238/types-consolidation-packages-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Rahulcheryala Rahulcheryala changed the title refactor: migrate types from apps/web to @plane/types [GIT-238] refactor: migrate types from apps/web to @plane/types Jun 3, 2026
@makeplane
Copy link
Copy Markdown

makeplane Bot commented Jun 3, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
apps/web/core/services/issue/issue_relation.service.ts (1)

8-11: ⚡ Quick win

Merge the duplicate @plane/types import.

TIssueRelationTypes is now imported from @plane/types (Line 11), duplicating the type import on Line 8. Consolidate them; the // helpers and // Plane-web comments (Lines 9–10) are now stale.

♻️ Proposed refactor
 import { API_BASE_URL } from "`@plane/constants`";
-import type { TIssueRelation, TIssue } from "`@plane/types`";
-// helpers
-// Plane-web
-import type { TIssueRelationTypes } from "`@plane/types`";
+import type { TIssue, TIssueRelation, TIssueRelationTypes } from "`@plane/types`";
 // services
 import { APIService } from "`@/services/api.service`";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/core/services/issue/issue_relation.service.ts` around lines 8 - 11,
The import of types from "`@plane/types`" is duplicated; remove the extra import
and consolidate TIssueRelation, TIssue, and TIssueRelationTypes into a single
type import. Update the import statement at the top of issue_relation.service.ts
to import { TIssueRelation, TIssue, TIssueRelationTypes } from "`@plane/types`"
and delete the stale "// helpers" and "// Plane-web" comment lines so only one
consolidated type import remains.
apps/web/core/store/issue/issue-details/relation.store.ts (1)

11-16: ⚡ Quick win

Merge the duplicate @plane/types import.

TIssueRelationTypes (Line 16) comes from @plane/types, the same module as the type import on Line 11. Combine into one statement; the // Plane-web comment on Line 14 no longer applies.

♻️ Proposed refactor
-import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue } from "`@plane/types`";
+import type {
+  TIssue,
+  TIssueRelation,
+  TIssueRelationIdMap,
+  TIssueRelationMap,
+  TIssueRelationTypes,
+} from "`@plane/types`";
 // components
 import type { TRelationObject } from "`@/components/issues/issue-detail-widgets/relations`";
-// Plane-web
 import { REVERSE_RELATIONS } from "`@/constants/gantt-chart`";
-import type { TIssueRelationTypes } from "`@plane/types`";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/core/store/issue/issue-details/relation.store.ts` around lines 11 -
16, The file has two separate imports from "`@plane/types`" (TIssueRelationIdMap,
TIssueRelationMap, TIssueRelation, TIssue and TIssueRelationTypes); merge these
into a single import statement that includes TIssueRelationTypes alongside
TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, and TIssue, remove the
now-misplaced "// Plane-web" comment, and keep the other imports
(TRelationObject and REVERSE_RELATIONS) unchanged so symbols like
TRelationObject and REVERSE_RELATIONS continue to be imported from their
original modules.
apps/web/core/store/issue/issue-details/root.store.ts (1)

9-26: ⚡ Quick win

Add TIssueRelationTypes to the existing @plane/types import block.

The new Line 26 import duplicates the @plane/types source already imported in the block on Lines 9–18. Fold it into that block to avoid a duplicate import statement.

♻️ Proposed refactor
 import type {
   TIssue,
   TIssueAttachment,
   TIssueComment,
   TIssueCommentReaction,
   TIssueLink,
   TIssueReaction,
+  TIssueRelationTypes,
   TIssueServiceType,
   TWorkItemWidgets,
 } from "`@plane/types`";
 // plane web store
 import { IssueActivityStore } from "`@/plane-web/store/issue/issue-details/activity.store`";
 import type {
   IIssueActivityStore,
   IIssueActivityStoreActions,
   TActivityLoader,
 } from "`@/plane-web/store/issue/issue-details/activity.store`";
-import type { TIssueRelationTypes } from "`@plane/types`";
 import type { IIssueRootStore } from "../root.store";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/core/store/issue/issue-details/root.store.ts` around lines 9 - 26,
The file has a duplicate import from "`@plane/types`" for TIssueRelationTypes;
update the first import block (which already imports TIssue, TIssueAttachment,
TIssueComment, TIssueCommentReaction, TIssueLink, TIssueReaction,
TIssueServiceType, TWorkItemWidgets) to also include TIssueRelationTypes and
remove the separate import line for TIssueRelationTypes so there is only one
consolidated import from "`@plane/types`" in root.store.ts (refer to the import
block and the standalone TIssueRelationTypes import to locate the changes).
apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx (1)

11-21: ⚡ Quick win

Consolidate the duplicate @plane/types type imports.

TIssueRelationTypes is imported via a separate import type from @plane/types even though other types are already imported from the same module; merge them into a single import type statement (and keep the // Plane-web comment scoped to Plane-web imports).

♻️ Proposed refactor
-import type { TIssue, TIssueServiceType } from "`@plane/types`";
+import type { TIssue, TIssueRelationTypes, TIssueServiceType } from "`@plane/types`";
 import { EIssueServiceType } from "`@plane/types`";
 import { Collapsible } from "`@plane/ui`";
 // components
 import { CreateUpdateIssueModal } from "`@/components/issues/issue-modal/modal`";
 // hooks
 import { useIssueDetail } from "`@/hooks/store/use-issue-detail`";
 // Plane-web
 import { CreateUpdateEpicModal } from "`@/plane-web/components/epics/epic-modal`";
 import { useTimeLineRelationOptions } from "`@/plane-web/components/relations`";
-import type { TIssueRelationTypes } from "`@plane/types`";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx`
around lines 11 - 21, Consolidate duplicate imports from "`@plane/types`" by
merging the separate import for TIssueRelationTypes into the existing import
that brings in TIssue and TIssueServiceType; keep EIssueServiceType as a value
import (import { EIssueServiceType }) and use a single import type { TIssue,
TIssueServiceType, TIssueRelationTypes } for types, and ensure the existing "//
Plane-web" comment remains only above Plane-web imports like
CreateUpdateEpicModal and useTimeLineRelationOptions to preserve grouping.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/types/src/issues/issue-property-values.ts`:
- Around line 7-8: Replace the overly-broad object types for
TIssuePropertyValues and TIssuePropertyValueErrors with keyed Record types so
consumers can index them safely; e.g. change export type TIssuePropertyValues =
object; and export type TIssuePropertyValueErrors = object; to something like
export type TIssuePropertyValues = Record<string, unknown>; and export type
TIssuePropertyValueErrors = Record<string, string | undefined>; (adjust the
value union to match actual value/error shapes used by IssueModalContext and
other consumers) so property access and indexing compile and remain type-safe.

---

Nitpick comments:
In `@apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx`:
- Around line 11-21: Consolidate duplicate imports from "`@plane/types`" by
merging the separate import for TIssueRelationTypes into the existing import
that brings in TIssue and TIssueServiceType; keep EIssueServiceType as a value
import (import { EIssueServiceType }) and use a single import type { TIssue,
TIssueServiceType, TIssueRelationTypes } for types, and ensure the existing "//
Plane-web" comment remains only above Plane-web imports like
CreateUpdateEpicModal and useTimeLineRelationOptions to preserve grouping.

In `@apps/web/core/services/issue/issue_relation.service.ts`:
- Around line 8-11: The import of types from "`@plane/types`" is duplicated;
remove the extra import and consolidate TIssueRelation, TIssue, and
TIssueRelationTypes into a single type import. Update the import statement at
the top of issue_relation.service.ts to import { TIssueRelation, TIssue,
TIssueRelationTypes } from "`@plane/types`" and delete the stale "// helpers" and
"// Plane-web" comment lines so only one consolidated type import remains.

In `@apps/web/core/store/issue/issue-details/relation.store.ts`:
- Around line 11-16: The file has two separate imports from "`@plane/types`"
(TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue and
TIssueRelationTypes); merge these into a single import statement that includes
TIssueRelationTypes alongside TIssueRelationIdMap, TIssueRelationMap,
TIssueRelation, and TIssue, remove the now-misplaced "// Plane-web" comment, and
keep the other imports (TRelationObject and REVERSE_RELATIONS) unchanged so
symbols like TRelationObject and REVERSE_RELATIONS continue to be imported from
their original modules.

In `@apps/web/core/store/issue/issue-details/root.store.ts`:
- Around line 9-26: The file has a duplicate import from "`@plane/types`" for
TIssueRelationTypes; update the first import block (which already imports
TIssue, TIssueAttachment, TIssueComment, TIssueCommentReaction, TIssueLink,
TIssueReaction, TIssueServiceType, TWorkItemWidgets) to also include
TIssueRelationTypes and remove the separate import line for TIssueRelationTypes
so there is only one consolidated import from "`@plane/types`" in root.store.ts
(refer to the import block and the standalone TIssueRelationTypes import to
locate the changes).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 18d9a988-97cf-42aa-a2b9-75147a33af35

📥 Commits

Reviewing files that changed from the base of the PR and between b6e47cc and dca6fc0.

📒 Files selected for processing (40)
  • apps/web/app/(all)/[workspaceSlug]/(projects)/extended-project-sidebar.tsx
  • apps/web/ce/components/breadcrumbs/project.tsx
  • apps/web/ce/components/projects/create/root.tsx
  • apps/web/ce/components/relations/index.tsx
  • apps/web/ce/hooks/pages/use-pages-pane-extensions.ts
  • apps/web/ce/types/index.ts
  • apps/web/ce/types/issue-types/index.ts
  • apps/web/ce/types/issue-types/issue-property-values.d.ts
  • apps/web/ce/types/pages/pane-extensions.ts
  • apps/web/ce/types/projects/index.ts
  • apps/web/ce/types/projects/projects.ts
  • apps/web/core/components/common/activity/activity-item.tsx
  • apps/web/core/components/common/activity/helper.tsx
  • apps/web/core/components/dropdowns/project/base.tsx
  • apps/web/core/components/issues/filters.tsx
  • apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx
  • apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx
  • apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx
  • apps/web/core/components/issues/issue-detail/relation-select.tsx
  • apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx
  • apps/web/core/components/issues/relations/issue-list-item.tsx
  • apps/web/core/components/issues/relations/issue-list.tsx
  • apps/web/core/components/navigation/customize-navigation-dialog.tsx
  • apps/web/core/components/navigation/project-header-button.tsx
  • apps/web/core/components/power-k/menus/projects.tsx
  • apps/web/core/components/project/create-project-modal.tsx
  • apps/web/core/components/project/create/common-attributes.tsx
  • apps/web/core/components/workspace/sidebar/projects-list.tsx
  • apps/web/core/constants/gantt-chart.ts
  • apps/web/core/hooks/use-navigation-preferences.ts
  • apps/web/core/services/issue/issue_relation.service.ts
  • apps/web/core/services/project/project.service.ts
  • apps/web/core/store/issue/issue-details/relation.store.ts
  • apps/web/core/store/issue/issue-details/root.store.ts
  • apps/web/core/store/project/project.store.ts
  • packages/types/src/index.ts
  • packages/types/src/issues/issue-property-values.ts
  • packages/types/src/navigation-preferences.ts
  • packages/types/src/project/activity.ts
  • packages/types/src/project/index.ts
💤 Files with no reviewable changes (6)
  • apps/web/ce/types/issue-types/issue-property-values.d.ts
  • apps/web/ce/types/projects/index.ts
  • apps/web/ce/types/projects/projects.ts
  • apps/web/ce/types/index.ts
  • apps/web/ce/types/issue-types/index.ts
  • apps/web/ce/types/pages/pane-extensions.ts

Comment thread packages/types/src/issues/issue-property-values.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant